package model

type Order struct {
	OrderId     uint   `json:"orderId" gorm:"type:bigint;primary_key;not null;autoIncrement"`
	OrderNo     string `json:"orderOn" gorm:"type:varchar(20);not null"`
	UserID      uint   `json:"userId" gorm:"type:bigint;not null"`
	TotalPrice  int    `json:"totalPrice" gorm:"type:int;not null"`
	PayStatus   int    `json:"payStatus" gorm:"type:tinyint;not null"`
	PayType     int    `json:"payType" gorm:"type:tinyint;not null"`
	PayTime     Time   `json:"payTime" gorm:"type:datetime;not null;default:null"`
	OrderStatus int    `json:"orderStatus" gorm:"type:tinyint;not null"`
	ExtraInfo   string `json:"extraInfo" gorm:"type:varchar(100);not null"`
	IsDeleted   uint   `json:"isDeleted" gorm:"type:tinyint(4);not null"`
	CreateTime  Time   `json:"createTime" gorm:"type:datetime;not null;default:current_timestamp"`
	UpdateTime  Time   `json:"updateTime" gorm:"type:datetime;not null;default:current_timestamp"`
}

// TableName 自定义表明，不适用默认的mall_users
func (receiver Order) TableName() string {
	return "tb_newbee_mall_order"
}
